Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix TypeError in SearchFormViewHelper #3728

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

tillhoerner
Copy link
Contributor

Problem:
Calling the s:searchForm ViewHelper with the pageType or suggestPageType argument with a value from a typoscript setting will lead to a TypeError

<s:searchForm pageType="{settings.pageType}" suggestPageType="{settings.suggestPageType}">

TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageType(): Argument #1 ($targetPageType) must be of type int, string given, called in /var/www/html/private/typo3conf/ext/solr/Classes/ViewHelpers/SearchFormViewHelper.php

Solution:
Cast both arguments to int

Copy link
Collaborator

@dkd-kaehm dkd-kaehm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Which versions are affected?
Do we want the backports?

@dkd-kaehm dkd-kaehm merged commit 110fff2 into TYPO3-Solr:main Jul 20, 2023
8 checks passed
@tillhoerner tillhoerner deleted the patch-1 branch August 16, 2023 10:39
@dkd-kaehm dkd-kaehm mentioned this pull request Oct 13, 2023
1 task
@holgerkraemer
Copy link

@dkd-kaehm
Version 11.5.5 is affected as well (Using PHP 8.2). Will there be a backport of this bugfix?

dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this pull request May 7, 2024
…lper

Problem:
Calling the `s:searchForm` ViewHelper with the `pageType` or `suggestPageType` argument with a value from a typoscript setting will lead to a TypeError

```html
<s:searchForm pageType="{settings.pageType}" suggestPageType="{settings.suggestPageType}">
```

`TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageType(): Argument #1 ($targetPageType) must be of type int, string given, called in /var/www/html/private/typo3conf/ext/solr/Classes/ViewHelpers/SearchFormViewHelper.php`

Solution:
Cast both arguments to int

Fixes: TYPO3-Solr#3927
Ports: TYPO3-Solr#3728
dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this pull request May 7, 2024
…lper

Problem:
Calling the `s:searchForm` ViewHelper with the `pageType` or `suggestPageType` argument with a value from a typoscript setting will lead to a TypeError

```html
<s:searchForm pageType="{settings.pageType}" suggestPageType="{settings.suggestPageType}">
```

`TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageType(): Argument #1 ($targetPageType) must be of type int, string given, called in /var/www/html/private/typo3conf/ext/solr/Classes/ViewHelpers/SearchFormViewHelper.php`

Solution:
Cast both arguments to int

Fixes: TYPO3-Solr#3927
Ports: TYPO3-Solr#3728
dkd-kaehm added a commit to dkd-kaehm/ext-solr that referenced this pull request May 7, 2024
…lper

Problem:
Calling the `s:searchForm` ViewHelper with the `pageType` or `suggestPageType` argument with a value from a typoscript setting will lead to a TypeError

```html
<s:searchForm pageType="{settings.pageType}" suggestPageType="{settings.suggestPageType}">
```

`TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageType(): Argument #1 ($targetPageType) must be of type int, string given, called in /var/www/html/private/typo3conf/ext/solr/Classes/ViewHelpers/SearchFormViewHelper.php`

Solution:
Cast both arguments to int

Fixes: TYPO3-Solr#3927
Ports: TYPO3-Solr#3728
dkd-kaehm added a commit that referenced this pull request May 7, 2024
…lper

Problem:
Calling the `s:searchForm` ViewHelper with the `pageType` or `suggestPageType` argument with a value from a typoscript setting will lead to a TypeError

```html
<s:searchForm pageType="{settings.pageType}" suggestPageType="{settings.suggestPageType}">
```

`TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder::setTargetPageType(): Argument #1 ($targetPageType) must be of type int, string given, called in /var/www/html/private/typo3conf/ext/solr/Classes/ViewHelpers/SearchFormViewHelper.php`

Solution:
Cast both arguments to int

Fixes: #3927
Ports: #3728
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants